package com.ruoyi.project.cyq.task.transfer.controller;


import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.cyq.task.postpone.domain.PostPone;
import com.ruoyi.project.cyq.task.postpone.domain.PostPoneVo;
import com.ruoyi.project.cyq.task.postpone.service.IPostPoneService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/cyq/task/transfer")
public class TransferController extends BaseController {

    private String perfix = "cyq/task/tasksfer";


    @Autowired
    private IPostPoneService iPostPoneService;

    /**
     * 展示延期申请的页面数据
     * @param postPone
     * @return
     */
    @RequiresPermissions("cyq:task:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(PostPone postPone) {
        startPage();
        List<PostPoneVo> list = iPostPoneService.selectPostPoneList(postPone);
        return getDataTable(list);
    }



    @RequiresPermissions("cyq:tasktransfer:apply")
    @GetMapping()
    public String approval(){
        return perfix + "/taskfer";
    }


    @RequiresPermissions("cyq:tasktransfer:check")
    @GetMapping("approval")
    public String show(){
        return perfix + "/taskferapprova";
    }
}
